<template id="search2">
  <div id="search2">
    <h1>Risk Grading System</h1>
    <div class="div1"> 
      <table margin="0 auto"> 
        <tr>
          <td class="td1">""  ""   "</td> 
          <td  width="322px">
            <div>
              <input type="text" placeholder="请输入地区或行业名称" v-model="msg">
            </div>
          </td>
          <td width="100px">
            <div>
              <button @click="showChildComponentData">评估</button>
            </div>
          </td> 
        </tr>
      </table>
    </div>
    <div id="list1" v-for="item of select">
      <p class="selectionItem" @click="selectName(item)">{{item}}</p>
    </div>
     <P> 已收录 {{ number }} 家机构 </P>
    <router-link to="/About">About</router-link> 
  </div>
</template>

<script type="text/javascript">
import jQuery from "jquery"

var getname = []
export default {
  data() {
    return {
      isshow: true,
      msg: "",
      films: [],
      select: [],
      number: "19982"
    };
  },
  methods: {
    showChildComponentData: function() {
      this.$store.state.keyword = this.msg;
      this.$router.push({ path: "/Result2" });
    },
    selectName(item) {
      console.log(item)
      this.msg = item
    }
  },
  watch: {
    msg: function(val, oldVal) {
      if (val.length === 0) {
        this.isshow = false;
      } else {
        var key = this.msg
        var province = {
    "44" : "广东",  
    "11" : "北京",  
    "33" : "浙江",  
    "35" : "福建",  
    "42" : "湖北",  
    "31" : "上海",  
    "32" : "江苏",  
    "12" : "天津",  
    "13" : "河北",  
    "14" : "山西",  
    "15" : "内蒙古",  
    "21" : "辽宁",  
    "22" : "吉林",  
    "23" : "黑龙江",  
    "34" : "安徽",  
    "36" : "江西",  
    "37" : "山东",  
    "41" : "河南",  
    "43" : "湖南",  
    "45" : "广西",  
    "46" : "海南",  
    "50" : "重庆",  
    "51" : "四川",  
    "52" : "贵州",  
    "53" : "云南",  
    "54" : "西藏",  
    "61" : "陕西",  
    "62" : "甘肃",  
    "63" : "青海",  
    "64" : "宁夏",  
    "65" : "新疆",  
    "71" : "台湾",  
    "81" : "香港",  
    "82" : "澳门"  
};  
var city = {  
    "11" : {  
        "1" : "东城",  
        "2" : "西城",  
        "3" : "崇文",  
        "4" : "宣武",  
        "5" : "朝阳",  
        "6" : "丰台",  
        "7" : "石景山",  
        "8" : "海淀",  
        "9" : "门头沟",  
        "11" : "房山",  
        "12" : "通州",  
        "13" : "顺义",  
        "14" : "昌平",  
        "15" : "大兴",  
        "16" : "怀柔",  
        "17" : "平谷",  
        "28" : "密云",  
        "29" : "延庆"  
    },  
    "12" : {  
        "1" : "和平区",  
        "2" : "河东区",  
        "3" : "河西区",  
        "4" : "南开区",  
        "5" : "河北区",  
        "6" : "红桥区",  
        "7" : "塘沽区",  
        "8" : "汉沽区",  
        "9" : "大港区",  
        "10" : "东丽区",  
        "11" : "西青区",  
        "12" : "津南区",  
        "13" : "北辰区",  
        "14" : "武清区",  
        "15" : "宝坻区",  
        "21" : "宁河县",  
        "23" : "静海县",  
        "25" : "蓟县",  
        "26" : "滨海新区",  
        "27" : "保税区"  
    },  
    "13" : {  
        "1" : "石家庄",  
        "2" : "唐山",  
        "3" : "秦皇岛",  
        "4" : "邯郸",  
        "5" : "邢台",  
        "6" : "保定",  
        "7" : "张家口",  
        "8" : "承德",  
        "9" : "沧州",  
        "10" : "廊坊",  
        "11" : "衡水"  
    },  
    "14" : {  
        "1" : "太原",  
        "2" : "大同",  
        "3" : "阳泉",  
        "4" : "长治",  
        "5" : "晋城",  
        "6" : "朔州",  
        "7" : "晋中",  
        "8" : "运城",  
        "9" : "忻州",  
        "10" : "临汾",  
        "23" : "吕梁"  
    },  
    "15" : {  
        "1" : "呼和浩特",  
        "2" : "包头",  
        "3" : "乌海",  
        "4" : "赤峰",  
        "5" : "通辽",  
        "6" : "鄂尔多斯",  
        "7" : "呼伦贝尔",  
        "22" : "兴安盟",  
        "25" : "锡林郭勒盟",  
        "26" : "乌兰察布盟",  
        "28" : "巴彦淖尔盟",  
        "29" : "阿拉善盟"  
    },  
    "21" : {  
        "1" : "沈阳",  
        "2" : "大连",  
        "3" : "鞍山",  
        "4" : "抚顺",  
        "5" : "本溪",  
        "6" : "丹东",  
        "7" : "锦州",  
        "8" : "营口",  
        "9" : "阜新",  
        "10" : "辽阳",  
        "11" : "盘锦",  
        "12" : "铁岭",  
        "13" : "朝阳",  
        "14" : "葫芦岛"  
    },  
    "22" : {  
        "1" : "长春",  
        "2" : "吉林",  
        "3" : "四平",  
        "4" : "辽源",  
        "5" : "通化",  
        "6" : "白山",  
        "7" : "松原",  
        "8" : "白城",  
        "24" : "延边朝鲜族自治州"  
    },  
    "23" : {  
        "1" : "哈尔滨",  
        "2" : "齐齐哈尔",  
        "3" : "鸡西",  
        "4" : "鹤岗",  
        "5" : "双鸭山",  
        "6" : "大庆",  
        "7" : "伊春",  
        "8" : "佳木斯",  
        "9" : "七台河",  
        "10" : "牡丹江",  
        "11" : "黑河",  
        "12" : "绥化",  
        "27" : "大兴安岭"  
    },  
    "31" : {  
        "1" : "黄浦区",  
        "3" : "卢湾区",  
        "4" : "徐汇区",  
        "5" : "长宁区",  
        "6" : "静安区",  
        "7" : "普陀区",  
        "8" : "闸北区",  
        "9" : "虹口区",  
        "10" : "杨浦区",  
        "12" : "闵行区",  
        "13" : "宝山区",  
        "14" : "嘉定区",  
        "15" : "浦东新区",  
        "16" : "金山区",  
        "17" : "松江区",  
        "18" : "青浦区",  
        "19" : "南汇区",  
        "20" : "奉贤区",  
        "30" : "崇明区"  
    },  
    "32" : {  
        "1" : "南京",  
        "2" : "无锡",  
        "3" : "徐州",  
        "4" : "常州",  
        "5" : "苏州",  
        "6" : "南通",  
        "7" : "连云港",  
        "8" : "淮安",  
        "9" : "盐城",  
        "10" : "扬州",  
        "11" : "镇江",  
        "12" : "泰州",  
        "13" : "宿迁"  
    },  
    "33" : {  
        "1" : "杭州",  
        "2" : "宁波",  
        "3" : "温州",  
        "4" : "嘉兴",  
        "5" : "湖州",  
        "6" : "绍兴",  
        "7" : "金华",  
        "8" : "衢州",  
        "9" : "舟山",  
        "10" : "台州",  
        "11" : "丽水"  
    },  
    "34" : {  
        "1" : "合肥",  
        "2" : "芜湖",  
        "3" : "蚌埠",  
        "4" : "淮南",  
        "5" : "马鞍山",  
        "6" : "淮北",  
        "7" : "铜陵",  
        "8" : "安庆",  
        "10" : "黄山",  
        "11" : "滁州",  
        "12" : "阜阳",  
        "13" : "宿州",  
        "14" : "巢湖",  
        "15" : "六安",  
        "16" : "亳州",  
        "17" : "池州",  
        "18" : "宣城"  
    },  
    "35" : {  
        "1" : "福州",  
        "2" : "厦门",  
        "3" : "莆田",  
        "4" : "三明",  
        "5" : "泉州",  
        "6" : "漳州",  
        "7" : "南平",  
        "8" : "龙岩",  
        "9" : "宁德"  
    },  
    "36" : {  
        "1" : "南昌",  
        "2" : "景德镇",  
        "3" : "萍乡",  
        "4" : "九江",  
        "5" : "新余",  
        "6" : "鹰潭",  
        "7" : "赣州",  
        "8" : "吉安",  
        "9" : "宜春",  
        "10" : "抚州",  
        "11" : "上饶"  
    },  
    "37" : {  
        "1" : "济南",  
        "2" : "青岛",  
        "3" : "淄博",  
        "4" : "枣庄",  
        "5" : "东营",  
        "6" : "烟台",  
        "7" : "潍坊",  
        "8" : "济宁",  
        "9" : "泰安",  
        "10" : "威海",  
        "11" : "日照",  
        "12" : "莱芜",  
        "13" : "临沂",  
        "14" : "德州",  
        "15" : "聊城",  
        "16" : "滨州",  
        "17" : "菏泽"  
    },  
    "41" : {  
        "1" : "郑州",  
        "2" : "开封",  
        "3" : "洛阳",  
        "4" : "平顶山",  
        "5" : "安阳",  
        "6" : "鹤壁",  
        "7" : "新乡",  
        "8" : "焦作",  
        "9" : "濮阳",  
        "10" : "许昌",  
        "11" : "漯河",  
        "12" : "三门峡",  
        "13" : "南阳",  
        "14" : "商丘",  
        "15" : "信阳",  
        "16" : "周口",  
        "17" : "驻马店",  
        "18" : "济源"  
    },  
    "42" : {  
        "1" : "武汉",  
        "2" : "黄石",  
        "3" : "十堰",  
        "5" : "宜昌",  
        "6" : "襄阳",  
        "7" : "鄂州",  
        "8" : "荆门",  
        "9" : "孝感",  
        "10" : "荆州",  
        "11" : "黄冈",  
        "12" : "咸宁",  
        "13" : "随州",  
        "28" : "恩施土家族苗族自治州",  
        "29" : "仙桃",  
        "30" : "潜江",  
        "31" : "天门",  
        "32" : "神农架"  
    },  
    "43" : {  
        "1" : "长沙",  
        "2" : "株洲",  
        "3" : "湘潭",  
        "4" : "衡阳",  
        "5" : "邵阳",  
        "6" : "岳阳",  
        "7" : "常德",  
        "8" : "张家界",  
        "9" : "益阳",  
        "10" : "郴州",  
        "11" : "永州",  
        "12" : "怀化",  
        "13" : "娄底",  
        "31" : "湘西土家族苗族自治州"  
    },  
    "44" : {  
        "1" : "广州",  
        "2" : "韶关",  
        "3" : "深圳",  
        "4" : "珠海",  
        "5" : "汕头",  
        "6" : "佛山",  
        "7" : "江门",  
        "8" : "湛江",  
        "9" : "茂名",  
        "12" : "肇庆",  
        "13" : "惠州",  
        "14" : "梅州",  
        "15" : "汕尾",  
        "16" : "河源",  
        "17" : "阳江",  
        "18" : "清远",  
        "19" : "东莞",  
        "20" : "中山",  
        "51" : "潮州",  
        "52" : "揭阳",  
        "53" : "云浮"  
    },  
    "45" : {  
        "1" : "南宁",  
        "3" : "桂林",  
        "4" : "梧州",  
        "5" : "北海",  
        "6" : "防城港",  
        "7" : "钦州",  
        "8" : "贵港",  
        "9" : "玉林",  
        "10" : "百色",  
        "11" : "贺州",  
        "12" : "河池",  
        "13" : "来宾",  
        "14" : "崇左",  
        "22" : "柳州"  
    },  
    "46" : {  
        "1" : "海口",  
        "2" : "三亚",  
        "90" : "其他"  
    },  
    "50" : {  
        "1" : "万州区",  
        "2" : "涪陵区",  
        "3" : "渝中区",  
        "4" : "大渡口区",  
        "5" : "江北区",  
        "6" : "沙坪坝区",  
        "7" : "九龙坡区",  
        "8" : "南岸区",  
        "9" : "北碚区",  
        "10" : "万盛区",  
        "11" : "双桥区",  
        "12" : "渝北区",  
        "13" : "巴南区",  
        "14" : "黔江区",  
        "15" : "长寿区",  
        "22" : "綦江县",  
        "23" : "潼南县",  
        "24" : "铜梁县",  
        "25" : "大足县",  
        "26" : "荣昌县",  
        "27" : "璧山县",  
        "28" : "梁平县",  
        "29" : "城口县",  
        "30" : "丰都县",  
        "31" : "垫江县",  
        "32" : "武隆县",  
        "33" : "忠县",  
        "34" : "开县",  
        "35" : "云阳县",  
        "36" : "奉节县",  
        "37" : "巫山县",  
        "38" : "巫溪县",  
        "40" : "石柱土家族自治县",  
        "41" : "秀山土家族苗族自治县",  
        "42" : "酉阳土家族苗族自治县",  
        "43" : "彭水苗族土家族自治县",  
        "81" : "江津区",  
        "82" : "合川市",  
        "83" : "永川区",  
        "84" : "南川市"  
    },  
    "51" : {  
        "1" : "成都",  
        "3" : "自贡",  
        "4" : "攀枝花",  
        "5" : "泸州",  
        "6" : "德阳",  
        "7" : "绵阳",  
        "8" : "广元",  
        "9" : "遂宁",  
        "10" : "内江",  
        "11" : "乐山",  
        "13" : "南充",  
        "14" : "眉山",  
        "15" : "宜宾",  
        "16" : "广安",  
        "17" : "达州",  
        "18" : "雅安",  
        "19" : "巴中",  
        "20" : "资阳",  
        "32" : "阿坝",  
        "33" : "甘孜",  
        "34" : "凉山"  
    },  
    "52" : {  
        "1" : "贵阳",  
        "2" : "六盘水",  
        "3" : "遵义",  
        "4" : "安顺",  
        "22" : "铜仁",  
        "23" : "黔西南",  
        "24" : "毕节",  
        "26" : "黔东南",  
        "27" : "黔南"  
    },  
    "53" : {  
        "1" : "昆明",  
        "3" : "曲靖",  
        "4" : "玉溪",  
        "5" : "保山",  
        "6" : "昭通",  
        "23" : "楚雄",  
        "25" : "红河",  
        "26" : "文山",  
        "27" : "思茅",  
        "28" : "西双版纳",  
        "29" : "大理",  
        "31" : "德宏",  
        "32" : "丽江",  
        "33" : "怒江",  
        "34" : "迪庆",  
        "35" : "临沧"  
    },  
    "54" : {  
        "1" : "拉萨",  
        "21" : "昌都",  
        "22" : "山南",  
        "23" : "日喀则",  
        "24" : "那曲",  
        "25" : "阿里",  
        "26" : "林芝"  
    },  
    "61" : {  
        "1" : "西安",  
        "2" : "铜川",  
        "3" : "宝鸡",  
        "4" : "咸阳",  
        "5" : "渭南",  
        "6" : "延安",  
        "7" : "汉中",  
        "8" : "榆林",  
        "9" : "安康",  
        "10" : "商洛"  
    },  
    "62" : {  
        "1" : "兰州市",  
        "2" : "嘉峪关",  
        "3" : "金昌",  
        "4" : "白银",  
        "5" : "天水",  
        "6" : "武威",  
        "7" : "张掖",  
        "8" : "平凉",  
        "9" : "酒泉",  
        "10" : "庆阳",  
        "24" : "定西",  
        "26" : "陇南",  
        "29" : "临夏",  
        "30" : "甘南"  
    },  
    "63" : {  
        "1" : "西宁",  
        "21" : "海东",  
        "22" : "海北",  
        "23" : "黄南",  
        "25" : "海南",  
        "26" : "果洛",  
        "27" : "玉树",  
        "28" : "海西"  
    },  
    "64" : {  
        "1" : "银川",  
        "2" : "石嘴山",  
        "3" : "吴忠",  
        "4" : "固原",  
        "5" : "中卫"  
    },  
    "65" : {  
        "1" : "乌鲁木齐",  
        "2" : "克拉玛依",  
        "21" : "吐鲁番",  
        "22" : "哈密",  
        "23" : "昌吉",  
        "27" : "博尔塔拉",  
        "28" : "巴音郭楞",  
        "29" : "阿克苏",  
        "30" : "克孜勒苏",  
        "31" : "喀什",  
        "32" : "和田",  
        "40" : "伊犁",  
        "42" : "塔城",  
        "43" : "阿勒泰",  
        "44" : "石河子"  
    },  
    "71" : {  
        "1" : "台北市",  
        "2" : "高雄市",  
        "3" : "基隆市",  
        "4" : "台中市",  
        "5" : "台南市",  
        "6" : "新竹市",  
        "7" : "嘉义市",  
        "8" : "台北县",  
        "9" : "宜兰县",  
        "10" : "桃园县",  
        "11" : "新竹县",  
        "12" : "苗栗县",  
        "13" : "台中县",  
        "14" : "彰化县",  
        "15" : "南投县",  
        "16" : "云林县",  
        "17" : "嘉义县",  
        "18" : "台南县",  
        "19" : "高雄县",  
        "20" : "屏东县",  
        "21" : "澎湖县",  
        "22" : "台东县",  
        "23" : "花莲县"  
    },  
    "81" : {  
        "2" : "中西区",  
        "3" : "东区",  
        "4" : "九龙城区",  
        "5" : "观塘区",  
        "6" : "南区",  
        "7" : "深水埗区",  
        "8" : "黄大仙区",  
        "9" : "湾仔区",  
        "10" : "油尖旺区",  
        "11" : "离岛区",  
        "12" : "葵青区",  
        "13" : "北区",  
        "14" : "西贡区",  
        "15" : "沙田区",  
        "16" : "屯门区",  
        "17" : "大埔区",  
        "18" : "荃湾区",  
        "19" : "元朗区"  
    },  
    "82" : {  
        "2" : "花地玛堂区",  
        "3" : "圣安多尼堂区",  
        "4" : "大堂区",  
        "5" : "望德堂区",  
        "6" : "风顺堂区",  
        "7" : "氹仔",  
        "8" : "路环"  
    }  
};
var dic=[{"个体":1},{"软件":1,"计算":1,"科技":1},{"超市":1,"销售":1,"商业":1,"商贸":1,"购物":1,"广场":1,"批发":1},{"水产":1,"羊肉":1,"牛肉":1,"面食":1,"火锅":1,"海鲜":1,"食品":1,"酒业":1,"美食":1,"糕点":1,"饮料":1,"饮品":1,"山泉":1,"乳业":1},{"果蔬":1,"水果":1,"蔬菜":1,"菜市":1},{"饭店":1,"酒店":1,"粮油":1,"酒庄":1,"小吃":1,"公寓":1,"餐厅":1,"餐馆":1},{"医院":1,"药业":1,"制药":1,"药店":1,"医药":1,"医疗":1},{"学校":1,"大学":1,"中学":1,"食堂":1},{"加油":1,"钢铁":1},{"肥料":1,"农业":1,"种业":1,"农药":1,"农机":1}]
    for(var item in province){
      if(key===province[item]){
        var city1=item
        var ori=city[city1]
        var resu=[]
        for(var item in ori){
          resu.push(ori[item])
        }
      }
    }
    var p=0
    for(var t=0;t<dic.length;t++){
      for(var item in dic[t]){
        if(key===item){
          p=t
          var resu=[]
          for(var item in dic[p]){
            resu.push(item)
          }
        }
      }
    }       
    this.select = resu
    this.isshow = true
  }
  }
  }
}
</script>



<style scoped>
ul {
  border: none;
}
.div1 {
  margin: 0 auto;
  width: 500px;
}
li {
  height: 40px;
  line-height: 60px;
  border-bottom: 1px solid #ddd;
}
input {
  text-align: center;
  font-size: 1.4em;
  height: 2.3em;
  border-radius: 8px;
  border: 1px solid #c8cccf;
  color: #6a6f77;
  -moz-appearance: none;
  display: block;
  outline: 0;
  width: 100%;
}
.td1 {
  visibility: hidden;
}
button {
  background-color: #4caf50; /* Green */
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 16px 2px;
  cursor: pointer;
  -webkit-transition-duration: 0.4s; /* Safari */
  transition-duration: 0.4s;
  border-radius: 8px;
}
button:hover {
  box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24),
    0 17px 50px 0 rgba(0, 0, 0, 0.19);
}
.tbl {
  border: 1px solid lightgray;
}
list1{
width: 324px;
margin-left: 17.1%;
list-style: none;

}
.selectionItem {
  font-weight: lighter;
  font-size: 18px;
  width: 324px;
  cursor: pointer;
  border: 0.02px solid lightgray;
  margin-top: 0rem;
  margin-bottom: 0rem;
  margin-left:33.8%;
}
.selectionItem:hover {
  color: orange;
}
.selectionItem:last {
  margin-bottom: 0;
}
</style>

